inherited fmDoljnostFood: TfmDoljnostFood
  Left = 490
  Top = 182
  Width = 1107
  Height = 438
  Caption = 'fmDoljnostFood'
  Constraints.MinHeight = 438
  Constraints.MinWidth = 682
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 384
    Width = 1099
  end
  inherited Panel1: TPanel
    Width = 1099
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 916
    end
    inherited BitBtn2: TBitBtn
      Left = 1004
    end
  end
  object dbgDoljnost: TcxGrid [2]
    Left = 0
    Top = 70
    Width = 1099
    Height = 314
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    LookAndFeel.SkinName = 'Office2007Silver'
    object tvDoljnost: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Enabled = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellDblClick = tvDoljnostCellDblClick
      OnCustomDrawCell = tvDoljnostCustomDrawCell
      DataController.DataSource = dsDoljnost
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skCount
          FieldName = 'PID'
          Column = tvDoljnostPID
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.FocusFirstCellOnNewRecord = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.DeletingConfirmation = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 5
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 1
      OptionsView.ColumnAutoWidth = True
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxGreenText
      Styles.Header = DMInv.cxSiniyText
      object tvDoljnostPID: TcxGridDBColumn
        DataBinding.FieldName = 'PID'
        Width = 31
      end
      object tvDoljnostPLASTNAME: TcxGridDBColumn
        Caption = #1060#1072#1084#1080#1083#1080#1103
        DataBinding.FieldName = 'PLASTNAME'
        Width = 75
      end
      object tvDoljnostPNAME: TcxGridDBColumn
        Caption = #1048#1084#1103
        DataBinding.FieldName = 'PNAME'
        Width = 68
      end
      object tvDoljnostPPATRONYMIC: TcxGridDBColumn
        Caption = #1054#1090#1095#1077#1089#1090#1074#1086
        DataBinding.FieldName = 'PPATRONYMIC'
        Width = 174
      end
      object tvDoljnostDOLJN: TcxGridDBColumn
        Caption = #1044#1086#1083#1078#1085#1086#1089#1090#1100
        DataBinding.FieldName = 'DOLJN'
        Width = 127
      end
      object tvDoljnostPARENTS_LIST: TcxGridDBColumn
        Caption = #1055#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077
        DataBinding.FieldName = 'PARENTS_LIST'
        Width = 150
      end
      object tvDoljnostM: TcxGridDBColumn
        DataBinding.FieldName = 'M'
        Visible = False
      end
    end
    object cxGridLevel2: TcxGridLevel
      GridView = tvDoljnost
    end
  end
  object dxBarDockControl1: TdxBarDockControl [3]
    Left = 0
    Top = 45
    Width = 1099
    Height = 25
    Align = dalTop
    BarManager = dxBarManager1
  end
  object dsDoljnost: TDataSource
    DataSet = qdoljnost
    Left = 272
    Top = 109
  end
  object qdoljnost: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT DP.DPID, dp.DOLID, dp.PID,COALESCE(P.PLASTNAME, '#39#1042#1072#1082#1072#1085#1089#1080#1103 +
        #39') AS PLASTNAME,'
      
        'COALESCE(P.PNAME,'#39#1042#1072#1082#1072#1085#1089#1080#1103#39') AS PNAME, COALESCE(P.PPATRONYMIC,'#39#1042 +
        #1072#1082#1072#1085#1089#1080#1103#39') AS PPATRONYMIC,'
      'SD.SDNAME AS DOLJN,'
      
        '(SELECT parents_list  FROM SP_GETTREEPARENTS(D.SDID, 28)) AS par' +
        'ents_list,'
      
        'COALESCE((SELECT FIRST 1 dm.DPID FROM DOLJNOST_MENU dm WHERE dm.' +
        'DPID = dp.DPID),0) AS m'
      'FROM DOLJNOST D'
      'LEFT OUTER JOIN DOLJNOST_PEOPLE DP ON dp.DOLID = d.DOLID'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = DP.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = D.SDID'
      
        'WHERE d.dolisdelete is null AND DP.DOLISDELETE IS NULL and sd.sd' +
        'isdelete = 0'
      
        'AND CURRENT_DATE BETWEEN dp.DOLDATEBEGIN AND COALESCE(dp.DOLDATE' +
        'END, CURRENT_DATE)'
      'order by 4'
      '')
    Left = 304
    Top = 109
    object qdoljnostDPID: TIntegerField
      FieldName = 'DPID'
      Origin = '"DOLJNOST_PEOPLE"."DPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qdoljnostDOLID: TIntegerField
      FieldName = 'DOLID'
      Origin = '"DOLJNOST_PEOPLE"."DOLID"'
    end
    object qdoljnostPID: TIntegerField
      FieldName = 'PID'
      Origin = '"DOLJNOST_PEOPLE"."PID"'
    end
    object qdoljnostPLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      ProviderFlags = []
      Size = 255
    end
    object qdoljnostPNAME: TIBStringField
      FieldName = 'PNAME'
      ProviderFlags = []
      Size = 255
    end
    object qdoljnostPPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      ProviderFlags = []
      Size = 255
    end
    object qdoljnostDOLJN: TIBStringField
      FieldName = 'DOLJN'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qdoljnostPARENTS_LIST: TIBStringField
      FieldName = 'PARENTS_LIST'
      ProviderFlags = []
      Size = 2048
    end
    object qdoljnostM: TIntegerField
      FieldName = 'M'
      ProviderFlags = []
    end
  end
  object dxBarManager1: TdxBarManager
    AllowReset = False
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    Categories.Strings = (
      'Default')
    Categories.ItemsVisibles = (
      2)
    Categories.Visibles = (
      True)
    ImageOptions.Images = DMInv.cxSmallImages
    LookAndFeel.Kind = lfFlat
    LookAndFeel.NativeStyle = False
    LookAndFeel.SkinName = 'Office2007Silver'
    NotDocking = [dsNone, dsLeft, dsTop, dsRight, dsBottom]
    PopupMenuLinks = <>
    ShowHint = False
    Style = bmsUseLookAndFeel
    UseSystemFont = True
    Left = 432
    Top = 187
    DockControlHeights = (
      0
      0
      0
      0)
    object dxBarManager1Bar4: TdxBar
      AllowClose = False
      AllowCustomizing = False
      AllowQuickCustomizing = False
      AllowReset = False
      Caption = 'Custom 4'
      CaptionButtons = <>
      DockControl = dxBarDockControl1
      DockedDockControl = dxBarDockControl1
      DockedLeft = 0
      DockedTop = 0
      FloatLeft = 422
      FloatTop = 147
      FloatClientWidth = 51
      FloatClientHeight = 44
      ItemLinks = <
        item
          Visible = True
          ItemName = 'bTrEdit'
        end
        item
          BeginGroup = True
          UserDefine = [udWidth]
          UserWidth = 314
          Visible = True
          ItemName = 'beSelectDoljnost'
        end
        item
          Visible = True
          ItemName = 'bbsearching'
        end>
      OneOnRow = True
      Row = 0
      UseOwnFont = False
      UseRestSpace = True
      Visible = True
      WholeRow = False
    end
    object bTrEdit: TdxBarButton
      Caption = 'New Button'
      Category = 0
      Hint = 'New Button'
      Visible = ivAlways
      ImageIndex = 54
      OnClick = bTrEditClick
    end
    object beSelectDoljnost: TcxBarEditItem
      Caption = #1042#1099#1073#1086#1088' '#1076#1086#1083#1078#1085#1086#1089#1090#1080
      Category = 0
      Hint = #1042#1099#1073#1086#1088' '#1076#1086#1083#1078#1085#1086#1089#1090#1080
      Visible = ivAlways
      OnChange = beSelectDoljnostChange
      ShowCaption = True
      Width = 100
      PropertiesClassName = 'TcxButtonEditProperties'
      Properties.Buttons = <
        item
          Default = True
        end>
      Properties.OnButtonClick = cxBarEditItem3PropertiesButtonClick
    end
    object bbsearching: TdxBarButton
      Caption = #1048#1089#1082#1072#1090#1100
      Category = 0
      Enabled = False
      Hint = #1048#1089#1082#1072#1090#1100
      Visible = ivAlways
      ImageIndex = 53
      PaintStyle = psCaptionGlyph
      OnClick = bbsearchingClick
    end
  end
  object qtemp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT DP.DPID, dp.DOLID, dp.PID,COALESCE(P.PLASTNAME, '#39#1042#1072#1082#1072#1085#1089#1080#1103 +
        #39') AS PLASTNAME,'
      
        'COALESCE(P.PNAME,'#39#1042#1072#1082#1072#1085#1089#1080#1103#39') AS PNAME, COALESCE(P.PPATRONYMIC,'#39#1042 +
        #1072#1082#1072#1085#1089#1080#1103#39') AS PPATRONYMIC,'
      'SD.SDNAME AS DOLJN,'
      
        '(SELECT parents_list  FROM SP_GETTREEPARENTS(D.SDID, 28)) AS par' +
        'ents_list,'
      
        'COALESCE((SELECT FIRST 1 dm.DPID FROM DOLJNOST_MENU dm WHERE dm.' +
        'DPID = dp.DPID),0) AS m'
      'FROM DOLJNOST D'
      'LEFT OUTER JOIN DOLJNOST_PEOPLE DP ON dp.DOLID = d.DOLID'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = DP.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = D.SDID'
      
        'WHERE d.dolisdelete is null AND DP.DOLISDELETE IS NULL and sd.sd' +
        'isdelete = 0'
      
        'AND CURRENT_DATE BETWEEN dp.DOLDATEBEGIN AND COALESCE(dp.DOLDATE' +
        'END, CURRENT_DATE)'
      ''
      '')
    Left = 304
    Top = 149
    object IntegerField1: TIntegerField
      FieldName = 'DPID'
      Origin = '"DOLJNOST_PEOPLE"."DPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object IntegerField2: TIntegerField
      FieldName = 'DOLID'
      Origin = '"DOLJNOST_PEOPLE"."DOLID"'
    end
    object IntegerField3: TIntegerField
      FieldName = 'PID'
      Origin = '"DOLJNOST_PEOPLE"."PID"'
    end
    object IBStringField1: TIBStringField
      FieldName = 'PLASTNAME'
      ProviderFlags = []
      Size = 255
    end
    object IBStringField2: TIBStringField
      FieldName = 'PNAME'
      ProviderFlags = []
      Size = 255
    end
    object IBStringField3: TIBStringField
      FieldName = 'PPATRONYMIC'
      ProviderFlags = []
      Size = 255
    end
    object IBStringField4: TIBStringField
      FieldName = 'DOLJN'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IBStringField5: TIBStringField
      FieldName = 'PARENTS_LIST'
      ProviderFlags = []
      Size = 2048
    end
    object IntegerField4: TIntegerField
      FieldName = 'M'
      ProviderFlags = []
    end
  end
  object qSD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.sdparid, t1.sdid, t1.sdname, t1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, SDISDELETE)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, sd.SDISDELETE FROM' +
        ' SYS_DIC SD'
      '      WHERE sd.SDPARID = :SDPARID'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, sd1.SDISDELETE'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  SDNAME, SDID, SDPARID, SDISDELETE FROM tree t'
      ') AS t1'
      
        'WHERE t1.SDISDELETE = 0 AND t1.sdparid <> 13096  AND t1.sdid <> ' +
        '13096')
    GeneratorField.Field = 'SDID'
    Left = 296
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'sdparid'
        ParamType = ptUnknown
      end>
    object qSDSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2303
    end
    object qSDSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qSDSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qSDSDISDELETE: TIntegerField
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
end
